﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using SmartPlant.Model.Biz;
using SmartPlant.Model.DbContext;
using SmartPlant.Services.Interfaces;
namespace SmartPlant.Services
{
    public class EquipService : BaseService, IEquipService
    {
        public async Task<List<Equipment>> GetEquipsAsync(decimal proId, decimal plantId)
        {
            var sqlwhere = $"EQUIP_ID>0 AND ENG_PROJ_ID='0' and plant_id = '{plantId}'";
            var select = "EQUIP_NAME EQUIPNAME,EQUIP_ID EQUIPID";
            var orderby = "EQUIP_NAME";
            string url = $"/api/Project/{proId}/Equipment-api?sqlwhere={sqlwhere}&select={select}&orderby={orderby}";
            var res = await GetAsync<List<Equipment>>(url);
            return res.data;
        }
    }
}
